package models

import (
	"iptv_server/v3/src/models/homevideo_model"
	othersmodel "iptv_server/v3/src/models/others_model"
	"time"

	"gorm.io/gorm"
)

type Model struct {
	ID        uint           `gorm:"primarykey" json:"id"`
	CreatedAt time.Time      `json:"-"`
	UpdatedAt time.Time      `json:"-"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}

func InitModels(db *gorm.DB) {
	// database.InitDatabase(db_host, db_port, db_dbname, db_user, db_password)

	db.AutoMigrate(new(homevideo_model.Home))
	db.AutoMigrate(new(homevideo_model.Category))
	db.AutoMigrate(new(homevideo_model.Detail))
	db.AutoMigrate(new(homevideo_model.Play))

	othersmodel.InitDB(db)

	RegisterSources()

}
